<?php
session_start();
include "Includes/solotrn_sesion.php";
include "Includes/soloFun_Generales.php";

$CboNodo = $_REQUEST["CboNodo"];

$TopNodo = 1;
if ($CboNodo == "") $CboNodo = $TopNodo; //'si es blanco le asigno el primer valor

//'rw "",CboNodo

SoloFun_ExecSql ("select * from solotb_nivel1", $SoloArrNodos);
$StrCboNodo = SoloFun_CargaCombo($SoloArrNodos,"CboNodo","$CboDisabled",$CboNodo," class='SoloStyle_Texto' style='width:200'","");


$MaxId = SoloFun_Maximo("id","solotb_parametros");
//$CboNodo = 1;
$strSql = "select * from solotb_parametros where nodo= ". $CboNodo;
if ($_REQUEST["OpbTipo"] == "P")
    $strSql = $strSql . " and descripcion like '" . $_REQUEST["txtParametro"] . "%'";

SoloFun_ExecSql ($strSql,$arrData);
?>
<html>
    <head>
        <title>SoloPortal - Par&aacute;metros</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <link rel="stylesheet" href="SoloStyles/Solostyles.css" type="text/css">
        <SCRIPT type="text/JavaScript" src="Includes/Solofun_generales.js"></SCRIPT>
    </head>
    <body topmargin="0" leftmargin="0" onkeydown="checkKey();">
        <p align="center" class="SoloStyle_TituloPaginas">Administrar Par&aacute;metros</p>
        <form name="frm" action="solotrn_AdministrarParametros.php" method="POST">
            <!-- TABLA DE CONSULTA INICIA -->
            <table border="0" width="60%" align="center" cellpadding="2" cellspacing="1" bordercolor="#CCCCCC">
                <tr>
                    <td>
                        <img src="iconos/soloico_nuevo.gif" border="1" alt="Ingresar Nuevo Registro" style="cursor:hand" onClick="SoloWindows('solotrn_GrabarParametro.php?Opcion=3&id=<?php echo $MaxId; ?>&CboNodo=<?php echo $CboNodo; ?>',200,200,450,350);" >
                        <img src="iconos/soloico_buscar.gif" border="1" alt="Buscar" style="cursor:hand" onClick="document.frm.submit();">
                    </td>
            </table>
            <table border=1 width="60%" align="center" cellpadding="2" cellspacing="1" bordercolor="#CCCCCC">
                <tr>
                    <td class="SoloStyle_Etiqueta">Subsecretar&iacute;a/Dir. Provincial</td>
                    <td class="SoloStyle_EtiquetaCajas"><?php echo $StrCboNodo; ?></td>
                </tr>
                <tr>
                    <td class="SoloStyle_Etiqueta">Criterio</td>
                    <td class="SoloStyle_EtiquetaCajas">
                        <input type="radio" name="OpbTipo2" value="G" checked onClick="document.all.OpbTipo.checked=0;">
                        General <input type="radio" name="OpbTipo" value="P" onClick="document.all.OpbTipo2.checked=0;">
                        Descripci&oacute;n
                        <input type="text" maxlenght="14" size="35" name="txtParametro" class="SoloStyle_Texto" onFocus="document.all.OpbTipo.value='P';document.all.OpbTipo.checked=1;document.all.OpbTipo2.checked=0;">
                    </td>
                </tr>
            </table>
            <!-- TABLA DE CONSULTA FINALIZA -->
            <input type="hidden" name="opc" value="C">
        </form>

        <table width="90%" border="1" align="center" bordercolor="#CCCCCC" cellpadding="0" cellspacing="1">
            <tr class="SoloStyle_Etiqueta">
                <td width="4%" height="20">id</td>
                <td width="38%">Descripci&oacute;n</td>
                <td width="39%">Valor</td>
                <td width="19%">Acci&oacute;n</td>
            </tr>
            <?php //'if bandPar then
            for ($i = 0; $i < count($arrData); $i++) {
                $clase = "SoloStyle_texto";
                if ($i%2 == 0) $clase = "SoloStyle_grid";
                ?>

            <tr>
                <td class="<?php echo $clase;?>"><?php echo $arrData[$i][0];?></td>

                <td class="<?php echo $clase;?>"><?php echo $arrData[$i][2];?></td>

                <td class="<?php echo $clase;?>"><?php echo $arrData[$i][3];?></td>

                <td class="<?php echo $clase;?>">&nbsp;
                    <a href="javascript:SoloFun_Windows('solotrn_GrabarParametro.php?id=<?php echo $arrData[$i][0];?>&ds=<?php echo $arrData[$i][2];?>&valor=<?php echo $arrData[$i][3];?>&Opcion=1&CboNodo=<?php echo $CboNodo;?>',200,200,450,350);"><img src="iconos/soloico_modificar.gif" alt="Modificar" border="0"></a>&nbsp;
                    <a href="javascript:SoloFun_Confirm('solotrn_GrabarParametro.php?id=<?php echo $arrData[$i][0];?>&ds=<?php echo $arrData[$i][2];?>&valor=<?php echo $arrData[$i][3];?>&Opcion=2&CboNodo=<?php echo $CboNodo;?>','Esta seguro que desea eliminar el Parametro?');"><img src="iconos/soloico_eliminar.gif" alt="Eliminar" border="0"></a></td>
            </tr>
                <?php }
            //'end if
            ?>
        </table>
        <BR>
    </body>
</html>
<?php
include "Includes/soloFun_ShowMessages.php";
?>